import { ref } from "vue";
import { defineStore } from "pinia";

export const useTabStore = defineStore(
  "tabIndex",
  () => {
    const primaryTabIndex = ref(0);
    const secondaryTabIndex = ref(0);
    function setPrimaryTab(value: number) {
      primaryTabIndex.value = value;
    }
    function setSecondaryTab(value: number) {
      secondaryTabIndex.value = value;
    }

    return {
      primaryTabIndex,
      secondaryTabIndex,
      setPrimaryTab,
      setSecondaryTab,
    };
  },
  {
    persist: true,
  }
);
